package org.cl.persist.system.data.dto;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author 86130
 */
@Getter
@Setter
@TableName("sys_dict")
public class Dict extends Model<Dict> {

    public static int SIMPLE_ID = 0;
    public static int MUTI_PARENT_ID = 1;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private Integer pId = 0;

    // 父类id 信息
    private String pids ="";

    // 字典归属
    @Min(0)
    private Integer project = 0;

    // 字典类型
    @Length(min=1, max=32)
    private String dtype;

    // 字典的key
    @Length(min=1, max=32)
    private String dkey;

    // 字典的值
    @NotNull
    private String dvalue;

    // 描述信息
    @Length(min=0, max=32)
    private String description;

    // 排序信息
    private Integer sort;

    // 被谁创建的ID 32
    private String createBy;

    // 创建的时间
    @TableField(fill = FieldFill.INSERT)
    private Date createDate;

    // 被修改人ID 32
    private String updateBy;

    // 修改的时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    // 删除 0 为删除 1 删除
    private Boolean delFlag;

    // 可扩展字典
    private String ext1;
    private String ext2;
    private String ext3;
}
